﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace TekaMUD.Engine
{
	/// <summary>
	/// Wrapper for app.config configuration values.
	/// </summary>
	public class Configuration
	{
		private static uint _NETWORK_BUFFER_SIZE_IN_BYTES;
		private static uint _SERVER_TCP_PORT;
		private static string _PLAYER_DIR;
		private static string _DATA_DIR;
		private static string _PARSER_COMPILED_GRAMMAR_PATH;
		private static uint _PLAYER_MAX_BACKPACK_ITEMS;
		private static string _DB_FILE;

		static Configuration()
		{
			_DB_FILE = ConfigurationManager.AppSettings["DB_FILE"];
			_NETWORK_BUFFER_SIZE_IN_BYTES = uint.Parse(ConfigurationManager.AppSettings["NETWORK_BUFFER_SIZE_IN_BYTES"]);
			_SERVER_TCP_PORT = uint.Parse(ConfigurationManager.AppSettings["SERVER_TCP_PORT"]);
			_PLAYER_MAX_BACKPACK_ITEMS = uint.Parse(ConfigurationManager.AppSettings["PLAYER_MAX_BACKPACK_ITEMS"]);
			_PARSER_COMPILED_GRAMMAR_PATH = ConfigurationManager.AppSettings["PARSER_COMPILED_GRAMMAR_PATH"];
		}

		public static string DB_FILE
		{
			get
			{
				return _DB_FILE;
			}
		}

		public static uint NETWORK_BUFFER_SIZE_IN_BYTES
		{
			get
			{
				return _NETWORK_BUFFER_SIZE_IN_BYTES;
			}
		}

		public static uint SERVER_TCP_PORT
		{
			get
			{
				return _SERVER_TCP_PORT;
			}
		}

		public static uint PLAYER_MAX_BACKPACK_ITEMS
		{
			get
			{
				return _PLAYER_MAX_BACKPACK_ITEMS;
			}
		}

		public static string PARSER_COMPILED_GRAMMAR_PATH
		{
			get
			{
				return _PARSER_COMPILED_GRAMMAR_PATH;
			}
		}
	}
}